#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//char* my_strncpy(char* dest, const char* sourse,size_t num) {
//	int i;
//	char* stare = dest;
//	for (i = 0; i < num; i++)
//	{
//		*(dest + i) = *(sourse + i);
//	}
//	return stare;
//}
//int main() {
//	char arr1[] = "abcdefg";
//	char arr2[20] = {0};
//	char* ret = my_strncpy(arr2, arr1,3);
//	printf("%s", ret);
//	return 0;
//}
#include<stdio.h>
char* my_strncat(char*dest,char*sourse,size_t num) {
	char* stare = dest;
	while (*dest != '\0') {
		dest++;
	}
	int i = 0;
	while(i< num&&*sourse) {
		*(dest+i)= *(sourse+i);
		i++;
	}
	*(dest+i) = '\0';
	return stare;
}
 int main() {
	char arr1[20] = "abc";
	char arr2[20] = "defg";
	char* ret = my_strncat(arr1, arr2,3);
	printf("%s", ret);
	return 0;
}